import request from "../utils/request";

export const loginApi = (data: any) => {
  return request({
    url: "/login",
    method: "post",
    data,
  });
};

export const getCity = (data?: any) => {
  return request({
    url: "/identifies",
    method: "get",
    params: data,
  });
};

//获取地图索引
export const getSearchAddress = (data: any) => {
  return request({
    url: "/address/autocomplete",
    method: "get",
    params: data,
  });
};

export const getPermissions = () => {
  return request({
    url: "/permissions",
    method: "get",
  });
};

//新增商户信息
export const addMerchant = (data: any) => {
  return request({
    url: "/identify/company",
    method: "post",
    data,
  });
};

//获取社区选项列表
export const getCommunityList = (data: any) => {
  return request({
    url: "/communities",
    method: "get",
    params: data,
  });
};
// 新增派出所
export const addPolice = (data: any) => {
  return request({
    url: "/identify/police",
    method: "post",
    data,
  });
};

// 获取用户详情
export const getUseDetails = (data: any) => {
  return request({
    url: "/identify",
    method: "get",
    params: data,
  });
};

// 修改商户信息
export const setUserDetails = (data: any) => {
  return request({
    url: "/identify/company",
    method: "put",
    data,
  });
};

// 修改公安信息
export const setUserPolice = (data: any) => {
  return request({
    url: "/identify/police",
    method: "put",
    data,
  });
};

//查询列表
export const getInquireList = (data: any) => {
  return request({
    url: "/identifies",
    method: "get",
    params: data,
  });
};

//修改密码
export const setPassword = (data: any) => {
  return request({
    url: "/reset_pwd",
    method: "post",
    data,
  });
};
